package com.tom.demo.controller.system;

import com.tom.demo.common.esEntity.SysLogDocIndex;
import com.tom.demo.common.response.Result;
import com.tom.demo.service.system.LogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Api(tags = {"日志管理"})
@RestController
@RequestMapping("/log")
public class LogController {

    @Resource
    private LogService logService;

    @PostMapping("/pageList")
    @ApiOperation(value = "日志分页查询")
    public Result pageList(@RequestParam(value = "page",defaultValue = "1")Integer page,
                           @RequestParam(value = "pageSize",defaultValue = "10")Integer pageSize,
                           @RequestBody SysLogDocIndex sysLogDocIndex){
        return logService.pageList(page,pageSize,sysLogDocIndex);
    }

    @DeleteMapping("/deleteById/{id}")
    @ApiOperation(value = "删除日志")
    public Result deleteById(@PathVariable(value = "id")String id){
        return logService.deleteById(id);
    }
}
